package com.ycx.ycxmybatismanagement.service.Impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.ycx.ycxmybatismanagement.dto.PageDTO;
import com.ycx.ycxmybatismanagement.entity.OperateLog;
import com.ycx.ycxmybatismanagement.mapper.LogMapper;
import com.ycx.ycxmybatismanagement.pojo.PageBean;
import com.ycx.ycxmybatismanagement.service.LogService;
import com.ycx.ycxmybatismanagement.vo.OperateLogVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class LogServiceImpl implements LogService {
    @Autowired
    private LogMapper logMapper;
    @Override
    public PageBean<OperateLogVO> logPage(PageDTO pageDTO) {
        PageHelper.startPage(pageDTO.getPage(), pageDTO.getPageSize());
        Page<OperateLogVO> logList = logMapper.logPage(pageDTO);

        return new PageBean(logList.getTotal(),logList.getResult());
    }
}
